package com.sky.mapper;

import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface OrdersMapper {
    void save(Orders orders);

    /**
     * 根据订单号查询订单
     * @param orderNum
     * @return
     */
    Orders findOrderByNum(String orderNum);

    /**
     * 根据id修改订单
     * @param build
     */
    void update(Orders build);

    /**
     * 查询超时订单
     * @return
     */
    List<Orders> findTimeoutOrders(@Param("status") Integer status,@Param("time") LocalDateTime time);

    /**
     * 统计具体某一天的营业额
     * @param date
     * @param status
     */
    Double getTurnover(@Param("date") LocalDate date, @Param("status") Integer status);
}
